﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules
{
    /// <summary>
    /// 人员考勤天数工时统计表
    ///</summary>
    [TableName("checkin_work_hours")]
    [Description("人员考勤天数工时统计表")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true, PropertyNamesOfArea = "MemberId")]
    [Serializable]
    public class CheckinWorkHours : IEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 成员id
        ///</summary>
        [Column("member_id")]
        public int MemberId { get; set; }

        /// <summary>
        /// yyyyMM
        ///</summary>
        [Column("month")]
        public int Month { get; set; }

        /// <summary>
        /// 项目Id
        ///</summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// 人员id
        ///</summary>
        [Column("person_id")]
        public int PersonId { get; set; }

        /// <summary>
        /// 企业id
        ///</summary>
        [Column("corp_id")]
        public int CorpId { get; set; }

        /// <summary>
        /// 班组id
        ///</summary>
        [Column("group_id")]
        public int GroupId { get; set; }

        /// <summary>
        /// 考勤天数
        ///</summary>
        [Column("checkin_day")]
        public int CheckinDay { get; set; }

        /// <summary>
        /// 工时
        ///</summary>
        [Column("work_hours")]
        public decimal WorkHours { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 最后一次更新时间
        ///</summary>
        [Column("last_update_time")]
        public DateTime LastUpdateTime { get; set; } = DateTime.Now;

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}